<template>
	<view class="media-item" @click="goThreadView(options.tid)">
		<view class="view" v-if="options.attnum>0">
			<view class="news-text">
				
				<view class="subject"><u-tag text="置顶" :closeable="false" v-if="options.topped" size="mini" />{{options.subject}}</view>
				<!-- <view class="from-forum">
					<u-tag :text="options.fname" :closeable="false" />
				</view> -->
				<view class="about-data">
					<text>{{options.author}}</text>
					<text>{{options.replies}}评</text>
					<text>{{$u.timeFrom(options.postdate, 'yyyy年mm月dd日')}}</text>
				</view>
			</view>
			<view class="thumb">
				<u-image :src="options.attach.length && options.attach[0]" width="250" height="150" mode="aspectFill"
				 :border-radius="10">
					<view slot="error" style="font-size: 24rpx;">加载失败</view>
				</u-image>
			</view>
		</view>
		<view class="view" v-else style="display: block;">

			<view class="news-text-full">
				<text class="subject">{{options.subject}}</text>
			</view>
			<view class="about-data">
				<text>{{options.author}}</text>
				<text>{{options.replies}}评</text>
				<text>{{$u.timeFrom(options.postdate, 'yyyy年mm月dd日')}}</text>
			</view>


		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		props: {
			options: {
				type: Object,

			}
		},
		methods: {
			goThreadView(tid) {
				this.$u.route('/pages/thread/thread', {
					tid: tid
				});
			}
		}
	}
</script>

<style>
	.u-tag {
		position: relative;
		top: -6rpx;
		margin-right: 5rpx;
	}

	.media-item {
		padding: 0 40rpx;
	}

	.view {
		display: flex;
		padding: 20rpx 0;
		border-bottom-color: #eee;
		border-bottom-style: solid;
		border-bottom-width: 1rpx;
	}

	.view .thumb {
		width: 250rpx;
		height: 150rpx;
		margin-top: 3rpx;
	}

	.view .news-text {
		text-align: justify;
		padding-right: 28rpx;
		width: calc(100% - 250rpx)
	}

	.view .news-text-full {
		width: 100%;
	}

	.view .news-text text {
		line-height: 50rpx;
	}

	.view .news-text .subject,
	.view .news-text-full {
		color: #000;
		font-size: 36rpx;
		font-weight: 400;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
	}

	.from-forum {
		margin-top: 5rpx;
	}

	.about-data {
		margin-top: 15rpx;
		color: #999;
		font-size: 24rpx;
	}

	.about-data text {
		margin-right: 10rpx;
	}
</style>
